echo ">>> 鲳鱼自制一键Android DAT提取脚本 ...    "
echo ">>> 请手动安装brotli后再运行脚本 ...    "
echo ">>>    请在确定当前目录所需文件   ...    "
echo ">>>       所需文件如下：  ...    "
echo ">>>    system.new.dat ...    "
echo ">>>  system.transfer.list ...    "
echo ">>>     建立工作所需文件中 ...    "
rm -rf ./ccache
rm -rf ./system
rm -rf ./system.img
rm -rf ./system.new.dat
mkdir ./ccache
mkdir ./system
echo ">>> dat.br转换中 ..."
brotli --decompress --in system.new.dat.br --out system.new.dat
echo ">>> 转换成功 ..."
python sdat2img.py system.transfer.list system.new.dat system.img
echo ">>> 准备提取STSTEM文件 ...    "
echo ">>> 请输入管理员密码 ...    "
echo ">>> 挂在镜像 ...    "
sudo mount system.img ./ccache
echo ">>>  复制文件 ...    "
sudo cp -r ccache system
echo ">>> 去掉sudo权限 ...    "
sudo chown -R changyuet system
echo ">>>  取消挂载镜像 ...    "
sudo umount system.img ./ccache
echo ">>>  删掉 ...    "
rm -rf ./ccache
mkdir ./ccache
cd ./system
mv ./ccache ./system
echo ">>> SYSTEM 提取完毕 ..."
echo ">>> 感谢使用 鲳鱼自制Android DAT提取脚本 ..."
echo ">>> 微博：weibo.com/10180016 ..."